package com.power.sifa.approve.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.stereotype.Component;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  申请审查的规范性文件实体类
*/

@Entity
@ApiModel(value="申请审查的规范性文件")
@Data
@Table(name="Apl_checkdoc",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Component
//@IdClass(Apl_checkdoc.Apl_checkdocPK.class) 用于复合组件
public class Apl_checkdoc extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "applyid+nanoid")
    private String id;

    @ApiModelProperty(value = "申请id")
    private String applyid;

    @ApiModelProperty(value = "规范性文件名称")
    private String docname;

    @ApiModelProperty(value = "规范性文件文号")
    private String doccode;

    @ApiModelProperty(value = "顺序号")
    private Integer sortnum;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("applyid", this.getApplyid());
        map.put("docname", this.getDocname());
        map.put("doccode", this.getDoccode());
        map.put("sortnum", this.getSortnum());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_checkdocPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_checkdocPK pk = (Apl_checkdocPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
